import request from '@/utils/request'

// 查询设备管理列表
export function listEquipment(query) {
  return request({
    url: '/base/equipment/list',
    method: 'get',
    params: query
  })
}
// 用户设备列表
export function listEquipmentUser(query) {
  return request({
    url: '/base/equipment/equipmentUserList',
    method: 'get',
    params: query
  })
}

// 用户设备列表
export function listUserEquipment() {
  return request({
    url: '/base/equipment/userEquipmentList',
    method: 'get'
  })
}

// 查询设备管理详细
export function getEquipment(id) {
  return request({
    url: '/base/equipment/' + id,
    method: 'get'
  })
}

// 查询设备管理详细
export function getEquipmentByNumber(number) {
  return request({
    url: '/base/equipment/getEquipmentByNumber/' + number,
    method: 'get'
  })
}

// 新增设备管理
export function addEquipment(data) {
  return request({
    url: '/base/equipment',
    method: 'post',
    data: data
  })
}
// 用户绑定设备
export function updateEquipmentUser(data) {
  return request({
    url: '/base/equipment/updateEquipmentUser',
    method: 'put',
    data: data
  })
}

// 删除设备管理
export function unbindEquipment(id) {
  return request({
    url: '/base/equipment/unbindEquipment/' + id,
    method: 'get'
  })
}
// 修改设备管理
export function updateEquipment(data) {
  return request({
    url: '/base/equipment',
    method: 'put',
    data: data
  })
}

// 删除设备管理
export function delEquipment(id) {
  return request({
    url: '/base/equipment/' + id,
    method: 'delete'
  })
}

// 导出设备管理
export function exportEquipment(query) {
  return request({
    url: '/base/equipment/export',
    method: 'get',
    params: query
  })
}
// 导出设备管理
export function equipmentModel() {
  return request({
    url: '/base/equipment/equipmentModel',
    method: 'get',
  })
}
// 导出安装记录
export function equipmentInstallModel() {
  return request({
    url: '/base/equipment/equipmentInstallModel',
    method: 'get',
  })
}

// 查询设备定位
export function location(equipmentNumber) {
  return request({
    url: '/base/equipment/location/' + equipmentNumber,
    method: 'get'
  })
}
// 查询设备定位
export function status(equipmentNumber) {
  return request({
    url: '/base/equipment/status/' + equipmentNumber,
    method: 'get'
  })
}

//重启设备
export function through2(equipmentNumber) {
  return request({
    url: '/base/equipment/through2/' + equipmentNumber,
    method: 'get'
  })
}
// 查询历史轨迹
export function track(query) {
  return request({
    url: '/base/equipment/track',
    method: 'get',
    params:query
  })
}

// 查询设备报警信息
export function retrieveAlarm(equipmentNumber) {
  return request({
    url: '/base/equipment/retrieveAlarm/'+equipmentNumber,
    method: 'get'
  })
}

// 车辆远程控制
export function control(query) {
  return request({
    url: '/base/equipment/control',
    method: 'get',
    params:query
  })
}
// 查询电子围栏
export function queryvf(equipmentNumber) {
  return request({
    url: '/base/equipment/queryvf/'+equipmentNumber,
    method: 'get'
  })
}
// 设置电子围栏
export function openvf(equipmentNumber) {
  return request({
    url: '/base/equipment/openvf/'+equipmentNumber,
    method: 'get'
  })
}
// 关闭电子围栏
export function closevf(equipmentNumber) {
  return request({
    url: '/base/equipment/closevf/'+equipmentNumber,
    method: 'get'
  })
}

export function vehicleSaleChart() {
  return request({
    url: '/base/equipment/vehicleSaleChart',
    method: 'get'
  })
}
export function vehicleSalePie() {
  return request({
    url: '/base/equipment/vehicleSalePie',
    method: 'get'
  })
}
export function vehicleSaleBar() {
  return request({
    url: '/base/equipment/vehicleSaleBar',
    method: 'get'
  })
}








